package com.web.exiaodao.business.repository;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.web.exiaodao.business.entity.MomentsInteraction;

import java.util.List;


public interface MomentsInteractionRepository extends
		PagingAndSortingRepository<MomentsInteraction, Long>,
		JpaSpecificationExecutor<MomentsInteraction> {
	public MomentsInteraction findByIdAndStatusNot(Long id,Integer status);

	/**
	 * 验证是否点赞
	 * @param userId
	 * @param momentId
	 * @return
	 */
	public List<MomentsInteraction> findByUserIdAndMomentIdAndType(Long userId, Long momentId, Integer type);

	/**
	 * 查询一条说说的评论列表
	 * @param momentId
	 * @param type 1：点赞、2：评论
	 * @return
	 */
	public List<MomentsInteraction> findByMomentIdAndTypeAndStatusNot(String momentId, Integer type, Integer status);
	public MomentsInteraction findByMomentIdAndTypeAndUserId(String momentId, Integer type, Long userId);

}
